package com.example.onlinemusic.controller;

import com.example.onlinemusic.model.User;
import com.example.onlinemusic.tools.ResponseBodyMessage;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/hhhh")
public class TestController {
    @RequestMapping("/test")
    public ResponseBodyMessage<User> Login(@RequestParam String username,
                                           @RequestParam String password){
        User user=new User();
        System.out.println("username"+username);
        System.out.println("password"+password);
        if(username.equals("bit")&&password.equals("123456")){
            user.setUsername(username);
            user.setPassword(password);
            return new ResponseBodyMessage<>(200,"登录成功",user);
        }else {
            return new ResponseBodyMessage<>(100,"登录失败",null);
        }
    }
}
